package com.jeesite.modules.common;


import java.io.Serializable;

/**
 * 系统自定义异常
 *
 * @author Junjie Xu
 * @date 2016-06-08
 */
public class BusinessException extends RuntimeException implements Serializable {

    private static final long serialVersionUID = 1L;

    private String errorCode;
    private String errorMsg;

    public BusinessException(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public BusinessException(ErrorEnum errorEnum) {
        this(errorEnum.getErrorCode(), errorEnum.getErrorMsg());
    }




    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
